package org.example.java.base;

/**
 * User: ZhangJuntao
 * Date: 13-11-21
 * Time: 下午2:38
 */
public class SplitTest {
  public static void main(String[] args) {
    String str = "welcome-to-hans-com";
    System.out.print("return value : ");
    for (String retval : str.split("-", 2)) {
      System.out.print(retval + "   ");
    }
    System.out.print("\nreturn value : ");
    for (String retval : str.split("-", 3)) {
      System.out.print(retval + "   ");
    }
    System.out.print("\nreturn value : ");
    for (String retval : str.split("-", 0)) {
      System.out.print(retval + "   ");
    }
    System.out.print("\nreturn value : ");
    for (String retval : str.split("-")) {
      System.out.print(retval + "   ");
    }
  }
}
